<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<script type="text/javascript">
$(document).ready(function() {
	$.ajax({
		url: '${base }/admin/article/getAllTypeList',
		cache: false,
		async:false,
		dataType: 'json',
		type: "post",
		error: function() {
		},
		success: function(data) {
			$.each(data, function(index, item) {
				$("#artTypeEdit").find('select').append("<option value='"+item.id+"'>"+item.name+"</option>");
			});
		}
	});
	$('#xh_editor').xheditor({
		tools: 'full',
		skin: 'default',
		upMultiple: 'false',
		upImgUrl: "!${base}/xheditor/xheditor_plugins/multiupload/multiupload.jsp",
		upImgExt: "jpg,jpeg,gif,png"
	});
});
</script>
<div class="pageContent">
	<form method="post" action="${base }/admin/article/${obj==null?'saveArticle':'updateArticle'}"
		enctype="multipart/form-data" class="pageForm required-validate"
		onsubmit="return validateCallback(this, navTabAjaxDone);">
		<div class="pageFormContent" layoutH="56">
			<table border="0" id="artTypeEdit">
				<tr style="height: 30px;">
					<td><label>标题：</label>
					</td>
					<td><input name="article.title" type="text" size="30" alt="请输入标题" value="${obj.title }"/>
						<input type="hidden" name="article.userId" value="${obj==null?user.id:obj.userId }" />
						<input type="hidden" name="article.id" value="${obj.id }" />
						<input type="hidden" name="content.id" value="${obj.id }" />
						<input type="hidden" name="article.postTime" value="${obj.postTime }" />
					</td>
				</tr>
				<tr style="height: 30px;">
					<td><label>分类目录：</label>
					</td>
					<td><select class="combox" name="article.typeId">
						<option value="${obj.typeId==null?0:obj.typeId }"></option>
					</select>
					</td>
				</tr>
				<tr style="height: 30px;">
					<td><label>内容：</label>
					</td>
					<td>
						<textarea id="xh_editor" class="editor" name="content.content" rows="28" cols="100"
								upMediaUrl="${base }/admin/article/upload" upMediaExt:"avi">
${obj.content.content }
						</textarea>
					</td>
				</tr>
			</table>
		</div>
		<div class="formBar">
			<ul>
				<!--<li><a class="buttonActive" href="javascript:void(0)"><span>保存</span></a></li>-->
				<li><div class="buttonActive">
						<div class="buttonContent">
							<button type="submit">保存</button>
						</div>
					</div>
				</li>
				<li>
					<div class="button">
						<div class="buttonContent">
							<button type="button" class="close">取消</button>
						</div>
					</div></li>
			</ul>
		</div>
	</form>
</div>
